/*
 * @Description: 工具栏配置
 * @Author: HuiSir<https://gitee.com/huisir001>
 * @Date: 2025-07-28 21:55:31
 * @LastEditTime: 2025-08-13 22:34:36
 */
import { defineToolsOptions } from "@/components/TablePage/predefined";
import useEditOptions from "./useEditOptions";
import { saveDept } from "@/api/sys";

export default defineToolsOptions(() => ({
  tools: ["add", "fold", "cols", "export", "refresh"],
  addRequest: saveDept,
  addDialogProps: { title: "新增部门" },
  addFormOptions: useEditOptions(),
  addFormDefaultData: {
    pid: "all",
  },
  getParamsBeforeDelete(selection) {
    return selection.map((item) => item.id).join(",");
  },
}));
